The ObjectManager allows for the creation and sharing of multiple object instances at runtime. It utilizes weak references to automatically free instances that are no longer used anywhere in the application. It automatically creates new instances for keys that are being encountered for the first time or after a previous instance with the same key has been released.
Object Model
Syntax
Visual Basic (Declaration) | |
---|
Public Class ObjectManager
(Of TKey,T As Class) |
C# | |
---|
public class ObjectManager<TKey,T>
where T: class |
C++/CLI | |
---|
generic<typename TKey>
generic<typename T>
public ref class ObjectManager
where T: ref class |
Type Parameters
- TKey
- The type of the key used to retrieve a shared instance.
- T
- The type of the instance.
Inheritance Hierarchy
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also